Working With Channel Devices
Sequence grabbers provide a number of functions that allow applications to determine the devices that can be, or the device that is, attached to a given sequence grabber channel. These devices, in turn, allow the channel component to control the digitizing equipment. For example, video channels use video digitizer components, and sound channels use sound input drivers. Applications can use these functions to present a list of available devices to the user, allowing the user to select a specific device for each channel. The sequence grabber passes these functions on to your channel component.The sequence grabber may use the
SGGetChannelDeviceList
function to retrieve a list of devices that may be used by your channel.The sequence grabber can use the
SGSetChannelDevice
function to assign a device to your channel.The
SGGetChannelDeviceList
function uses a device list structure to pass information about one or more channel devices. TheSGDeviceListRecord
data type defines the format of the device list structure.
typedef struct SGDeviceListRecord { short count; /* count of devices */ short selectedIndex; /* current device */ long reserved; /* set to 0 */ SGDeviceName entry[1]; /* device names */ } SGDeviceListRecord, *SGDeviceListPtr, **SGDeviceList;Device list structures contain an array of device name structures. Each device name structure identifies a single device that may be used by the channel. The
Field Description
count
- Indicates the number of devices described by this structure. The value of this field corresponds to the number of entries in the device name array defined by the
entry
field.selectedIndex
Identifies the currently active device. The value of this field corresponds to the appropriate entry in the device name array defined by theentry
field. Note that this value is 0-relative; that is, the first entry has an index number of 0, the second's value is 1, and so on.reserved
- Reserved for Apple. Always set to 0.
entry
- Contains an array of device name structures. Each structure corresponds to one valid device. The
count
field indicates the number of entries in this array. TheSGDeviceName
data type defines the format of a device name structure; this data type is discussed next.SGDeviceName
data type defines the format of a device name structure.
typedef struct SGDeviceName { Str63 name; /* device name */ Handle icon; /* device icon */ long flags; /* flags */ long refCon; /* set to 0 */ long reserved; /* set to 0 */ } SGDeviceName;Field descriptions
name
- Contains the name of the device. For video digitizer components, this field contains the component's name as specified in the component resource. For sound input drivers, this field contains the driver name.
icon
- Contains a handle to the device's icon. Some devices may support an icon, which applications may choose to present to the user. If the device does not support an icon, or if the sequence grabber chooses not to retrieve this information (by setting the
sgDeviceListWithIcons
flag to 0 when it calls theSGGetChannelDeviceList
function, which is described in the next section), set this field tonil
.flags
- Reflects the current status of the device. The following flag is defined:
sgDeviceNameFlagDeviceUnavailable
- When set to 1, this flag indicates that this device is not currently available.
refCon
- Reserved for Apple. Always set to 0.
reserved
- Reserved for Apple. Always set to 0.
Subtopics
- SGGetChannelDeviceList
- SGSetChannelDevice
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help